package com.hziee.mail.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import com.hziee.mail.model.AddressInfoEntity;
import com.hziee.mail.model.SkuInfoListEntity;
import com.hziee.mail.service.AddressService;
import com.hziee.mail.service.CartService;
import com.hziee.mail.util.FormatReturn;
import com.hziee.mail.util.RedisUtil;
import com.hziee.mail.util.SpringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @author ZX
 */
@RestController
@RequestMapping("/address")
public class AddressController extends FormatReturn {

    @Autowired
    private AddressService addressService;


    @GetMapping("show_address")
    public String showAddress(Integer userId, HttpServletResponse response) {
        List<AddressInfoEntity> list = addressService.showAddress(userId);
        return ajaxReturn(response, 1, "success", list);
    }

}
